package org.opens.service.impl;

import org.opens.dao.ProductDao;
import org.opens.entity.Product;
import org.opens.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductDao productDao;

    @Override
    public Product findById(Integer id) {
        Assert.notNull(id, "查询id不能为null");

        return productDao.findById(id).orElse(null);
    }
}
